    <template>
  <transition name="dialog-fade">
    <el-dialog v-if="seatuserDialog" title="固定座位用户" class="dialog-seatuser" append-to-body :visible.sync="seatuserDialog" width="50%">
      <el-table :data="userData" max-height="500" border style="width: 100%">
        <el-table-column prop="nickname" label="姓名"></el-table-column>
        <el-table-column prop="phone" label="手机"></el-table-column>
        <el-table-column prop="seat_number" label="座位号"></el-table-column>
        <el-table-column prop="sub_start" label="到期时间"></el-table-column>
        <el-table-column prop="store_name" label="门店"></el-table-column>
      </el-table>
      <div style="width:100%;text-align:center;margin:50px auto;">
              <el-pagination
                background
                :page-size="10"
                :page-sizes="[10, 20, 50, 100]"
                 layout="total,prev, sizes, pager, next, jumper"
                :total="totle"
                  @size-change="handleSizeChange1"
                @current-change="fenyeBtn1"
              ></el-pagination>
            </div>
    </el-dialog>
  </transition>
</template>

<script>
import { userFixed } from '@/api/user';
import Base64 from "@/utils/base";
// import { getuserid } from '../../utils/auth'
export default {
  name: "DialogSeatuser",
  props: {
    // msg: {
    //   type: String,
    //   default: ''
    // },
    dialogTitle: {
      type: String,
      default: ""
    },
    itemInfo: {
      type: Object,
      default: function() {
        return {};
      }
    }
  },
  data() {
    return {
      userData: "",
      seatuserDialog: false,
      page:1,
      page: 1,
      totle:10,
      num:10,
    };
  },
  mounted() {
    // this.getOpt()
  },
  created(){
    this.getdata()
  },
  methods: {
    handleSizeChange1(val) {
      this.num = val
      this.getdatas(this.page,this.num);
    },
    fenyeBtn1(e) {
      this.page = e;
      this.getdatas(this.page,this.num);
    },
    getdatas(page,num) {
       let params = {
         page: page || this.page,
         limit: num || this.num,
       }
      userFixed({
        request_data: Base64.encode(JSON.stringify(params))
      }).then(res => {
         if(res.status==2){
          this.$message({
            message:res.message,
            type:'warning'
          })
          return
        }
        this.userData = res.result.data
      });
    },
     getdata(page,num) {
       let params = {
         page: 1,
         limit: 10,
       }
      userFixed({
        request_data: Base64.encode(JSON.stringify(params))
      }).then(res => {
         if(res.status==2){
          this.$message({
            message:res.message,
            type:'warning'
          })
          return
        }
        this.userData = res.result.data
        this.totle = res.result.count
      });
    },
    //   获取下拉框
    // getOpt() {
    //   this.getRequest('/asset/getTypeList', {}).then(res => {
    //     this.options = res.obj
    //   })
    // },
    // 保存操作
    submitForm(formName) {
      const that = this;
      //   const params = Object.assign(that.formInfo, {});
      that.$refs[formName].validate(valid => {
        if (valid) {
          //   if (that.msg === 1) {
          //     Updata({
          //       'name': that.formInfo.name,
          //       'code': String(that.formInfo.code),
          //       'userId': Number(getuserid()),
          //       'status': that.formInfo.status,
          //       'id': that.formInfo.id
          //     }).then(res => {
          //       that.$message({
          //         message: '操作成功！',
          //         type: 'success'
          //       })
          //     })
          //   } else {
          //   }
          // 走保存请求
        } else {
          return false;
        }
      });
    }
  }
};
</script>

<style scoped lang="scss">
.dialog-fade-enter-active {
  -webkit-animation: dialog-fade-in 0.3s;
  animation: dialog-fade-in 0.3s;
}
.dialog-fade-leave-active {
  -webkit-animation: dialog-fade-out 0.3s;
  animation: dialog-fade-out 0.3s;
}
@-webkit-keyframes dialog-fade-in {
  0% {
    -webkit-transform: translate3d(0, -20px, 0);
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }
  100% {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes dialog-fade-in {
  0% {
    -webkit-transform: translate3d(0, -20px, 0);
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }
  100% {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@-webkit-keyframes dialog-fade-out {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    -webkit-transform: translate3d(0, -20px, 0);
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }
}
@keyframes dialog-fade-out {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    -webkit-transform: translate3d(0, -20px, 0);
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }
}
</style>
